package com.example.communist_app_api.sensitive;
import com.example.communist_app_api.service.WordService;
import com.github.houbb.sensitive.word.api.IWordAllow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * @Date：2022/12/12 14:50
 * @Filename：MyWordAllow
 *
 */
@Component
public class MyDdWordAllow implements IWordAllow {

    @Autowired
    private WordService wordService;

    @Override
    public List<String> allow() {
        //从数据库中获取所有符合要求的word对象
        //从数据库中寻找 状态status为正常，类型type是允许的单词
        List<String> allowList = wordService.selectAllWordByNormalAndAllow();
        return allowList;
    }

}
